import enumeration from './enumeration';

export const MASTER_USER_UUID = '2c72138b-ee16-4bd6-b7ba-6c01fade2553';

export enum Direction {
  DESC = 'DESC',
  'ASC' = 'ASC',
}

export enum FileGroup {
  CAROUSEL = 'carousel',
  ARTICLE = 'article',
  BRAND = 'brand',
  USER = 'user',
  EVALUATION_IMPULSE_RESPONSE = 'evaluation_impulse_response',
  AUDIO_SYNTHESIS = 'audio_synthesis',
  TEMP_AUDIO_SYNTHESIS = 'temp_audio_synthesis',
  EVALUATION_DATA_IMG = 'evaluation_data_img',
  TEMP_EQ_AUDIO = 'temp_eq_audio',

}

export enum BooleanNumber {
  false = 0,
  true = 1,
}

export enum BooleanString {
  false = '0',
  true = '1',
}

export enum UserTitleCertification {
  NORMAL = '',
  V = 'V',
  HIGH_V = 'HIGH_V',
}

export const userTitleCertification = enumeration<UserTitleCertification>(
  UserTitleCertification,
  {
    [UserTitleCertification.NORMAL]: '普通',
    [UserTitleCertification.V]: '普通认证',
    [UserTitleCertification.HIGH_V]: '高级认证',
  },
);

export enum UserType {
  NORMAL = '',
  ADMIN = 'ADMIN',
}

export enum MessageContentType {
  'ARTICLE_BE_PUBLISH', // 文章被置为已发布
  'ARTICLE_BE_REVIEW_BY_SYSTEM', // 文章被系统置为审核中
  'ARTICLE_BE_REVIEW', // 文章被管理员置为审核中
  'ARTICLE_BE_REJECT', // 文章被置为驳回
  'ARTICLE_BE_STICK', // 文章被置顶
  'ARTICLE_BE_UNSTICK', // 文章被取消置顶
}

export enum ArticleType {
  NORMAL = 'NORMAL',
  EVALUATION = 'EVALUATION',
}

export enum ArticleStatus {
  DRAFT = 'DRAFT',
  REVIEW = 'REVIEW',
  PUBLISH = 'PUBLISH',
  REJECT = 'REJECT',
}
export const articleStatus = enumeration<ArticleStatus>(ArticleStatus, {
  [ArticleStatus.DRAFT]: '草稿',
  [ArticleStatus.REVIEW]: '审核中',
  [ArticleStatus.PUBLISH]: '已发布',
  [ArticleStatus.REJECT]: '被驳回',
});
export const articleStatusColor = enumeration<ArticleStatus>(ArticleStatus, {
  [ArticleStatus.DRAFT]: 'default',
  [ArticleStatus.REVIEW]: 'warning',
  [ArticleStatus.PUBLISH]: 'success',
  [ArticleStatus.REJECT]: 'error',
});

export enum EvaluationStatus {
  UNPUBLISH = 'UNPUBLISH',
  PUBLISH = 'PUBLISH',
}
export const evaluationStatus = enumeration<EvaluationStatus>(
  EvaluationStatus,
  {
    [EvaluationStatus.UNPUBLISH]: '未发布',
    [EvaluationStatus.PUBLISH]: '已发布',
  },
);

export enum EvaluationProjectType {
  DIGITAL = 'DIGITAL',
  IMG = 'IMG',
  TABLE = 'TABLE',
}
export const evaluationProjectType = enumeration<EvaluationProjectType>(
  EvaluationProjectType,
  {
    [EvaluationProjectType.DIGITAL]: '数字数据',
    [EvaluationProjectType.IMG]: '图片',
    [EvaluationProjectType.TABLE]: '表格',
  },
);

export enum CarouselMobileJumpType {
  NONE = 'NONE',
  SELF = 'SELF',
  BILIBILI = 'BILIBILI',
}
export const carouselMobileJumpType = enumeration<CarouselMobileJumpType>(
  CarouselMobileJumpType,
  {
    [CarouselMobileJumpType.NONE]: '无',
    [CarouselMobileJumpType.SELF]: '本站',
    [CarouselMobileJumpType.BILIBILI]: 'BILIBILI',
  },
);

/**
 * 这个枚举不允许有交集的单词，如NEWS和NEWS_PLAY这种
 */
export enum ArticleNormalCategory {
  NEWS = 'NEWS',
  POINT = 'POINT',
  REVIEW = 'REVIEW',
  HIFI_DISCUSS = 'HIFI_DISCUSS',
}
export const articleNormalCategory = enumeration<ArticleNormalCategory>(
  ArticleNormalCategory,
  {
    [ArticleNormalCategory.NEWS]: '新闻/展会',
    [ArticleNormalCategory.POINT]: '观点',
    [ArticleNormalCategory.REVIEW]: '评测/技术',
    [ArticleNormalCategory.HIFI_DISCUSS]: 'HiFi交流区',
  },
);

export enum EvaluationCategory {
  EARBUDS = 'EARBUDS',
  SOUND_SOURCE = 'SOUND_SOURCE',
}
export const evaluationCategory = enumeration<EvaluationCategory>(
  EvaluationCategory,
  {
    [EvaluationCategory.EARBUDS]: '耳机数据',
    [EvaluationCategory.SOUND_SOURCE]: '音源数据',
  },
);

export enum CarouselPositionCode {
  HOME_MAIN = 'HOME_MAIN',
  EARBUDS_LIST_TOP_LEFT = 'EARBUDS_LIST_TOP_LEFT',
  EARBUDS_LIST_TOP_RIGHT = 'EARBUDS_LIST_TOP_RIGHT',
  SOUND_SOURCE_LIST_TOP_LEFT = 'SOUND_SOURCE_LIST_TOP_LEFT',
  SOUND_SOURCE_LIST_TOP_RIGHT = 'SOUND_SOURCE_LIST_TOP_RIGHT',
  NEWS_LIST_TOP_LEFT = 'NEWS_LIST_TOP_LEFT',
  NEWS_LIST_TOP_RIGHT = 'NEWS_LIST_TOP_RIGHT',
  POINT_LIST_TOP_LEFT = 'POINT_LIST_TOP_LEFT',
  POINT_LIST_TOP_RIGHT = 'POINT_LIST_TOP_RIGHT',
  REVIEW_LIST_TOP_LEFT = 'REVIEW_LIST_TOP_LEFT',
  REVIEW_LIST_TOP_RIGHT = 'REVIEW_LIST_TOP_RIGHT',
  HIFI_DISCUSS_LIST_TOP_LEFT = 'HIFI_DISCUSS_LIST_TOP_LEFT',
  HIFI_DISCUSS_LIST_TOP_RIGHT = 'HIFI_DISCUSS_LIST_TOP_RIGHT',
  PERSONAL_TOP = 'PERSONAL_TOP',
}
export const carouselPositionCode = enumeration<
  CarouselPositionCode,
  {
    name: string;
    desc: string;
  }
>(CarouselPositionCode, {
  [CarouselPositionCode.HOME_MAIN]: {
    name: '首页主轮播',
    desc: '宽高比为750x200，宽尽量大于1500px',
  },
  [CarouselPositionCode.EARBUDS_LIST_TOP_LEFT]: {
    name: '耳机数据列表上方左',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.EARBUDS_LIST_TOP_RIGHT]: {
    name: '耳机数据列表上方右',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.SOUND_SOURCE_LIST_TOP_LEFT]: {
    name: '音源数据列表上方左',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.SOUND_SOURCE_LIST_TOP_RIGHT]: {
    name: '音源数据列表上方右',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.NEWS_LIST_TOP_LEFT]: {
    name: '新闻/展会文章列表上方左',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.NEWS_LIST_TOP_RIGHT]: {
    name: '新闻/展会文章列表上方右',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.POINT_LIST_TOP_LEFT]: {
    name: '观点文章列表上方左',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.POINT_LIST_TOP_RIGHT]: {
    name: '观点文章列表上方右',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.REVIEW_LIST_TOP_LEFT]: {
    name: '评测/技术文章列表上方左',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.REVIEW_LIST_TOP_RIGHT]: {
    name: '评测/技术文章列表上方右',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.HIFI_DISCUSS_LIST_TOP_LEFT]: {
    name: 'HiFi交流区文章列表上方左',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.HIFI_DISCUSS_LIST_TOP_RIGHT]: {
    name: 'HiFi交流区文章列表上方右',
    desc: '宽659px x 高100px',
  },
  [CarouselPositionCode.PERSONAL_TOP]: {
    name: '个人中心上方',
    desc: '宽1800px x 高60px，内容居中',
  },
});

export enum SpecificationValueType {
  SELECT = 'SELECT',
  TEXT = 'TEXT',
  NUMBER = 'NUMBER',
}

export enum SendVcodeType {
  USER_REGISTER = 'USER_REGISTER', // 注册用户
  USER_LOGIN = 'USER_LOGIN', // 登陆
  USER_RESET_PWD = 'USER_RESET_PWD', // 重置密码
}

export enum SendMineVcodeType {
  USER_RESET_MY_PWD = 'USER_RESET_MY_PWD', // 重置自己密码
}

export enum SimulationAlgoType {
  /** 仅模拟调音 */
  TONING = 'TONING',
  /** 仅模拟失真 */
  DISTORTION = 'DISTORTION',
  /** 1:1完全定向模拟 */
  TONING_DISTORTION = 'TONING_DISTORTION',
}

export const simulationAlgoType = enumeration<SimulationAlgoType>(
  SimulationAlgoType,
  {
    [SimulationAlgoType.TONING]: '仅模拟调音',
    [SimulationAlgoType.DISTORTION]: '仅模拟失真',
    [SimulationAlgoType.TONING_DISTORTION]: '1:1完全定向模拟',
  },
);

export enum AudioSynthesisStatus {
  WAITING = 'WAITING',
  DOWNLOADING_IMPULSE_RESPONSE_FILE_FROM_OSS = 'DOWNLOADING_IMPULSE_RESPONSE_FILE_FROM_OSS',
  DOWNLOAD_USER_AUDIO_FILE_FROM_OSS = 'DOWNLOAD_USER_AUDIO_FILE_FROM_OSS',
  COMPUTING = 'COMPUTING',
  UPLOADING_FINAL_FILE = 'UPLOADING_FINAL_FILE',
  SUCCESS = 'SUCCESS',
  FAIL = 'FAIL',
  TIMEOUT = 'TIMEOUT',
}
export const audioSynthesisStatus = enumeration<AudioSynthesisStatus>(
  AudioSynthesisStatus,
  {
    [AudioSynthesisStatus.WAITING]: '等待中',
    [AudioSynthesisStatus.DOWNLOADING_IMPULSE_RESPONSE_FILE_FROM_OSS]:
      '正在加载特性文件',
    [AudioSynthesisStatus.DOWNLOAD_USER_AUDIO_FILE_FROM_OSS]:
      '正在加载源音频文件',
    [AudioSynthesisStatus.COMPUTING]: '算法计算中',
    [AudioSynthesisStatus.UPLOADING_FINAL_FILE]: '正在生成新音频文件',
    [AudioSynthesisStatus.SUCCESS]: '生成成功',
    [AudioSynthesisStatus.FAIL]: '未找到当前特性文件',
    [AudioSynthesisStatus.TIMEOUT]: '生成超时',
  },
);

export const AUDIO_SYNTHESIS_FINALLY_STATUS_LIST = [
  AudioSynthesisStatus.SUCCESS,
  AudioSynthesisStatus.FAIL,
  AudioSynthesisStatus.TIMEOUT,
];

export const AUDIO_SYNTHESIS_COUNT_BY_PER_USER_PER_DAY = 10;

export const AUDIO_SYNTHESIS_FILE_CLEAN_DAYS = 7;

export const EQ_AUDIO_FILE_CLEAN_DAYS = 3;

export enum EarBudsWearingMethod {
  EARBUDS = 'EARBUDS',
  HEADPHONES = 'HEADPHONES',
}
export const earBudsWearingMethod = enumeration<EarBudsWearingMethod>(
  EarBudsWearingMethod,
  {
    [EarBudsWearingMethod.EARBUDS]: '随身耳机',
    [EarBudsWearingMethod.HEADPHONES]:
      '头戴式耳机',
  },
);